package tech.aistar.service.comment.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.Answer;
import tech.aistar.mapper.comment.AnswerMapper;
import tech.aistar.service.comment.IAnswerService;

import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2019/10/4 0004.
 */
@Service
@Transactional
public class AnswerServiceImpl implements IAnswerService {
    @Autowired
    private AnswerMapper answerMapper;

    @Override
    public Answer anSave(Answer answer) {
        answerMapper.anSave(answer);
        return answer;
    }

    @Override
    public Answer anfindone(Integer id) {
      Answer answer = answerMapper.anfindone(id);
      return  answer;

    }

    @Override
    public List<Answer> antime(Date time) {
        List<Answer> answers = answerMapper.antime(new Date());
        return answers;
    }

    @Override
    public List<Answer> userId(Integer userinfoId) {
        List<Answer> answers = answerMapper.userId(userinfoId);
        return answers;
    }

    @Override
    public List<Answer> serviceId(Integer serviceId) {
        List<Answer> answers = answerMapper.serviceId(serviceId);
        return answers;
    }

    @Override
    public Integer ancounts(Integer id) {
        answerMapper.ancounts(id);
        return id;
    }
}
